package xiao.ke.sbdemo.dao;/**
 * @author XuXiaoK
 * @create 2019-12-19 11:33
 */

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import xiao.ke.sbdemo.po.Type;

import java.util.List;

/**
 * @Author XiaoKe
 * @Date 2019/12/19 11:33
 * @Description TODO
 */
@Repository
public interface TypeRepository extends JpaRepository<Type, Long> {

    Type findByName(String name);

    @Query("select t from Type t")
    List<Type> findTop(Pageable pageable);
}
